package decorator_pattern;

/**
 * 装饰器测试类
 *
 * @author wangzg13
 * @since 2022/7/30
 */
public class Client {


    public static void main(String[] args) {
        //    创建组件对象
        Component concreteComponent = new ConcreteComponent();
        //    对组件对象进行装饰
        concreteComponent = new ADecorator(concreteComponent);
        concreteComponent = new BDecorator(concreteComponent);
        concreteComponent.operate();
        //    最后装饰的最先实现
    }
}
